package com.jb.web.application;

import com.jb.web.bean.Page;
import com.jb.web.bean.BeanFactory;
import com.jb.web.bean.event.UIEvent;
import com.jb.web.context.WebContext;

public class Wizard {
    Page page;
    String parent;
    String type;
    String pageName;
    String panelName;
    Object object;
    public Wizard() {
    }

    public void setParent(String parent) {
        this.parent = parent;
    }

    public String getParent() {
        return parent;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setPageName(String pageName) {
        this.pageName = pageName;
    }

    public String getPageName() {
        return pageName;
    }

    public void setPanelName(String panelName) {
        this.panelName = panelName;
    }

    public String getPanelName() {
        return panelName;
    }
    
    public void create(WebContext ctx, UIEvent event) {
        object = BeanFactory.addNewComponent(ctx, page, parent, type);
    }
    
    public void next(WebContext ctx, UIEvent event) {
        //object = AddComponentEvent.addNewComponent(ctx, parent, type);
    }
     
    public void cancel(WebContext ctx, UIEvent event) {
         //object = AddComponentEvent.addNewComponent(ctx, parent, type);
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public Object getObject() {
        return object;
    }

    public void setPage(Page page) {
        this.page = page;
    }

    public Page getPage() {
        return page;
    }
}
